import { testHosArtifact } from '../../../plugins/common-artifact-fun';
import {
  AbilityType,
  APIType,
  APIVersion,
  LanguageType,
  ModuleTemplateType,
  RuntimeOSType,
  SDKType
} from '../../../plugins/project-builder/models/constants';
import { TestCaseBuilder } from '../../../plugins/task-builder/task-case-builder';
import { ProjectBuildOption } from '../../../plugins/task-builder/test-case';
import { TestTaskOptionBuilder } from '../../../plugins/task-builder/test-task-option';

const projectBuilderOption: ProjectBuildOption = {
  template: {
    sdk: SDKType.Single,
    runtimeOS: RuntimeOSType.HarmonyOS,
    apiVersion: APIVersion.API10,
    apiType: APIType.STAGE,
    language: LanguageType.ArkTs,
    abilityType: AbilityType.Application,
    entryTemplateType: ModuleTemplateType.EmptyAbility
  },
  modulesOption: {
    [ModuleTemplateType.SharedLibrary]: 1,
    [ModuleTemplateType.StaticLibrary]: 1,
    [ModuleTemplateType.StaticLibraryWithC]: 1,
  }
};

TestCaseBuilder.builder()
  .caseName('artifact_without_loss_hos_api10')
  .description('HarmonyOS，API10，增量模式下，切换buildMode，构建产物不丢失')
  .projectBuilderOption(projectBuilderOption)
  .taskConfig(TestTaskOptionBuilder.defaultOpt())
  .testFun(testHosArtifact)
  .load();
